package com.pan.kang.demo.contorller;

import com.pan.kang.core.DecoratorInterfaceFactory;
import com.pan.kang.demo.decoratorService.impl.UserDecoratorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user")
public class UserController {

    /**
     * 增强类通过工厂获取
     */
    @Autowired
    private DecoratorInterfaceFactory decoratorInterfaceFactory;

    @PostMapping(path = "/V1.0/apply")
    public void apply() {
        UserDecoratorService userDecoratorService =
                decoratorInterfaceFactory.getDecoratorService(UserDecoratorService.class);
        userDecoratorService.applyCallback();
    }
}
